<?php
class KomaSystemWhoOnline extends KomaBlock
{
    function main()
    {   
        $this->Database->query("SELECT * FROM ".$this->Database->prefix('session')." WHERE session_expire > ".time());
        $num_rows = $this->Database->numRows();
        $num_rows = $num_rows == 0 ? 1 : $num_rows;
    
        $online = sprintf(T_ngettext('%d user are online', '%d users are online', $num_rows), $num_rows);
    
        $this->Title = T_('Who\'s Online');
        $this->Template->File = 'whoonline.html';
        $this->Template->assign('online', $online);
        
        return true;
    }
}
?>
